<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html >
<html>
<head>
<title>文章列表</title>
<%@include file="/common/jsp/taglib.jsp"%>

<script type="text/javascript" >

//跳转到编辑页面
function editArticle(id){
	var url = ctx + "article/edit.do";
	//在编辑页面, 点击返回 和 提交 按钮, 都得回到列表页面, 
	//把回到列表页面的参数带着,保证修改列表页面只需修改数据库即可
	var param = {
			statement: '${statement}',
			tourl: '${tourl}',
			id : id
	}
	common.loadPage(url,param);
	
}

//跳转到新增页面
function addArticle(){
	var url = ctx + "article/toAdd.do";
	var param = {
			statement: '${statement}',
			tourl: '${tourl}'
	}
	common.loadPage(url,param);
}




</script>
</head>
<body>


	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<header class="panel-heading">
					<span class="tools pull-left"> 
					<a class="icon-search" style="padding:10px;" href="javascript:void(0);" onclick="goUp(this);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</span>
					<div class="clearfix">
						<div class="pull-right">
							<span class="label btn label-success green"
								onclick="addArticle();">&nbsp;增加&nbsp;<i
								class="icon-plus"></i>&nbsp;
							</span>
						</div>
					</div>
				</header>
				<div class="panel-body" style="display: none;">
					<form id="searchMenuForm" role="form" class="form-inline" >
					<input type="hidden" name="statement" value="${statement }"  />
					<input type="hidden" name="tourl" value="${tourl }"  />
                        <div class="form-group">
                            <label for="menuName" >文章名称</label>
                            <input type="text" placeholder="head" name="head" id="head" value="${mp.head }" class="form-control" >
                        </div>
                        <button style="margin-top: 23px;"  class="btn btn-success" type="button" onclick="common.submitForm('searchMenuForm')"  >查询</button>
                        <button style="margin-top: 23px;"  class="btn btn-default" type="button" onclick="common.clearForm('searchMenuForm')">重置</button>
                    </form>
					
				</div>


				<table class="table table-striped table-advance table-hover">
					<thead>
						<tr>

							<th><i class="icon-bookmark"></i>序号</th>
							<th><i class="icon-bookmark"></i>文章标题</th>
							<th style="width:500px;" ><i class="icon-bookmark" ></i>副标题</th>
							<th><i class="icon-bookmark"></i>文章类别</th>
							<th><i class="icon-bookmark"></i>序号</th>
							<th><i class="icon-bookmark"></i>上次修改时间</th>
							<th><i class="icon-edit"></i> 操作</th>

						</tr>
					</thead>
					<tbody>
					<!--  id, pid, name, permission, VALUE , POSITION, lev -->
						<c:forEach var="p" items="${pageGrid.rows }" varStatus="ind">
							<tr>
								<td>${ind.index +1}__${p.id }</td>
								<td>${p.head }</td>
								<td>${p.subhead }</td>
								<td>${p.type2 }</td>
								<td>${p.position }</td>
								<td>${p.time }</td>
								
								<td>
									<button class="btn btn-primary btn-xs"
										onclick="editArticle(${p.id});">
										<i class="icon-edit" title="编辑">编辑</i>
									</button>
								</td>
								
							</tr>
						</c:forEach>

					</tbody>
				</table>
			</section>
		</div>
	</div>


	<!-- 主体内容结束 -->
	<!-- 分页 -->
	<input type="hidden" value="searchMenuForm" id="currentFormId" />
	<jsp:include page="/common/system/pager.jsp" flush="true" />





</body>
</html>